﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MessageRouter.Configuration;

namespace MessageRouter.ServiceBroker.Activation
{
    internal abstract class ServiceBrokerMessageReaderActivator
    {
        private readonly ServiceBrokerEndpointAddress endpointAddress;

        public ServiceBrokerMessageReaderActivator(ServiceBrokerEndpointAddress endpointAddress)
        {
            this.endpointAddress = endpointAddress;
        }

        public ServiceBrokerEndpointAddress EndpointAddress
        {
            get { return this.endpointAddress; }
        }

        public event EventHandler Activation;
        protected virtual void OnActivation()
        {
            var handle = this.Activation;
            if (handle != null)
            {
                handle(this, new EventArgs());
            }
        }

        public virtual void Open() { }
        public virtual void Close() { }
    }
}
